package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.cgz;
import o.eqx;
import o.ewm.d;
import o.ewm.j;

public class SubCatCard extends BaseDistCard {
    private RelativeLayout ʻ;
    private Context ʽ;
    private ImageView ˋ;
    private View ॱॱ;

    public SubCatCard(Context context) {
        super(context);
        this.ʽ = context;
    }

    public cgz ˏ(View view) {
        this.ˋ = (ImageView) view.findViewById(j.ʻˊ);
        ॱ((TextView) view.findViewById(j.ʽ));
        this.ॱॱ = view.findViewById(j.ᐩ);
        this.ʻ = (RelativeLayout) view.findViewById(j.ʳᐝ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        eqx.ˏ(this.ˋ, ((BaseCardBean) cardBean).ॱˌ(), "circle_default_icon");
        this.ॱॱ.setVisibility(ˊᐝ() ? 0 : 4);
        ˋ(cardBean);
    }

    private void ˋ(@NonNull CardBean cardBean) {
        if (cardBean.ॱᐨ()) {
            LayoutParams layoutParams = (LayoutParams) this.ʻ.getLayoutParams();
            layoutParams.bottomMargin = this.ʽ.getResources().getDimensionPixelSize(d.ˊॱ);
            this.ʻ.setLayoutParams(layoutParams);
        }
    }

    public void ˋ() {
        LayoutParams layoutParams = (LayoutParams) this.ʻ.getLayoutParams();
        layoutParams.topMargin = this.ʽ.getResources().getDimensionPixelSize(d.ˋॱ);
        this.ʻ.setLayoutParams(layoutParams);
    }
}
